$(function(){
	
    // 精选 爆料 热点
    $(".cisc .m-title li").hover(function(){
        var index=$(".cisc .m-title li").index($(this));
        $(".cisc .m-title li a").removeClass("active");
        $(this).find("a").addClass("active");
        $(".txHotPic").addClass("hidden").eq(index).removeClass("hidden");
    });

    // 点击下一屏
    var _btnUP = $("#fixedBtn .top");
    var _btnDown = $("#fixedBtn .down");
    var _this = $('html,body');
    var upHeight = $(window).height();
    function scrollUp(){
      _this.animate({scrollTop:"-=" + upHeight + "px"},150);

    }
    function scrollDown(){
      _this.animate({scrollTop:"+=" + upHeight + "px"},150);

    }
    _btnUP.bind("click",scrollUp);
    _btnDown.bind("click",scrollDown);

    // 闲置过久 弹窗
    var y_tipsContent = "";
    var n = "";
    var maxTime = 30; // seconds
    var time = maxTime;
    $('body').on('keydown mousemove mousedown', function(e){
        time = maxTime; // reset
    });
    var intervalId = setInterval(function(){
        time--;
        if(time <= 0) {
            ShowInvalidLoginMessage();
            clearInterval(intervalId);
        }
    }, 1000)
    function ShowInvalidLoginMessage(){
        n +='<a href="/n/20190312/7896.html" target="_blank" title="网曝唐艺昕与吴秀波调情   男友张若昀发文怒怼网友"><img src="http://i1.akjunshi.com/upload/2019/0312/252310cc7fff6.jpeg" alt="网曝唐艺昕与吴秀波调情   男友张若昀发文怒怼网友"></a>';
        n +='<span class="opacity"></span>';
        n +='<span class="opacity_tit"><a href="/n/20190312/7896.html" target="_blank" title="网曝唐艺昕与吴秀波调情   男友张若昀发文怒怼网友">网曝唐艺昕与吴秀波调情   男友张若昀发文怒怼网友</a></span>';

        y_tipsContent +='<div class="tips-pop"><div class="y_shadow_bg"></div>';
        y_tipsContent +='<div class="y_tan"><div class="y_tanTit"><span class="y_title">本网页已闲置过久，点击关闭或空白处，即可</span><span class="y_tanClose"></span></div>';
            y_tipsContent +='<div class="y_tanCon clearfix">';
               y_tipsContent +='<div class="y_left">';
                  y_tipsContent +='<div class="img-title big_img">'+ n +'</div>';
                  y_tipsContent +='<div class="img-title small_img">'+ n +'</div>';
                  y_tipsContent +='<div class="img-title small_img">'+ n +'</div>';
               y_tipsContent +='</div>';
               y_tipsContent +='<div class="y_right">';
                  y_tipsContent +='<div class="img-title middle_img">'+ n +'</div>';
                  y_tipsContent +='<div class="img-title middle_img">'+ n +'</div>';
               y_tipsContent +='</div>';
            y_tipsContent +='</div>';
        y_tipsContent +='</div>';
        y_tipsContent +='</div>'
        
        $("body").append(y_tipsContent);
    }
    
    $(document).on("click", ".y_tanClose,.y_shadow_bg", function(){ 
       $(".tips-pop").hide(); 
    }); 
})